import agconnect from '@hw-agconnect/api-ohos';
import '@hw-agconnect/core-ohos';
import '@hw-agconnect/auth-ohos';
import { LogUtil } from '../common/utils/LogUtil';

export function getAGConnect(context) {
  try {
    agconnect.instance().init(context);
    LogUtil.info("init AGC SDK success.");
    return agconnect;
  } catch (err) {
    LogUtil.error(`init AGC SDK failed. Cause: ${JSON.stringify(err)}`);
  }
}